//
//  RootViewController.m
//  TravelOcean
//
//  Created by double Mac on 15/3/7.
//  Copyright (c) 2015年 double Mac. All rights reserved.
//

#import "RootViewController.h"

static NSString * const kJVGithubProjectPage = @"http://chanyouji.com/";

@interface RootViewController ()

@end

@implementation RootViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.view.backgroundColor = [UIColor yellowColor];
    
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"399-list1@3x.png"] style:UIBarButtonItemStylePlain target:self action:@selector(leftBarButtonAction:)];
    
    self.webview = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 667)];
    self.webview.scrollView.bounces = NO;
    
    NSURL *webpageURL = [NSURL URLWithString:kJVGithubProjectPage];
    NSURLRequest *webpageRequest = [NSURLRequest requestWithURL:webpageURL];
    [self.webview loadRequest:webpageRequest];
    
    [self.view addSubview:self.webview];
    [_webview release];
    
    UIImageView *downView = [[UIImageView alloc] initWithFrame:CGRectMake(0, self.view.frame.size.height - 49 - 64, self.view.frame.size.width, 49)];
    downView.image = [UIImage imageNamed:@"navbar_bg@2x.png"];
    //    downView.backgroundColor = [UIColor greenColor];
    [self.view addSubview:downView];
    [downView release];
    
}

- (void)leftBarButtonAction:(UIBarButtonItem *)barButton
{
    [[AppDelegate globalDelegate] toggleLeftDrawer:self animated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
